home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / extras / Direct3D / Tools / Maya25 / xportTranslator.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-08  |  1.8 KB  |  82 lines

  1. #ifndef xfileTranslator_h
  2. #define xfileTranslator_h
  3.  
  4.  
  5.  
  6.  
  7. #include <maya/MPxFileTranslator.h>
  8.  
  9. #include <MDt.h>
  10.  
  11.  
  12.  
  13. class xfileTranslator: public MPxFileTranslator 
  14. {
  15.     public:
  16.  
  17.         xfileTranslator() {};
  18.        ~xfileTranslator() {};
  19.  
  20.         static void*    creator ()    { return new xfileTranslator(); };
  21.  
  22.         MStatus            reader(const MFileObject& file,
  23.                                const MString& optionsString,
  24.                                MPxFileTranslator::FileAccessMode mode)    { return MS::kSuccess; };
  25.  
  26.         MStatus         writer(const MFileObject& file,
  27.                                const MString& optionsString,
  28.                                MPxFileTranslator::FileAccessMode mode);
  29.  
  30.         bool            haveReadMethod()    const    { return false; };
  31.         bool            haveWriteMethod()    const    { return true; };
  32.         bool            canBeOpened()        const    { return false; };
  33.         MString         defaultExtension()    const    { return ""; };
  34.         MFileKind       identifyFile (const MFileObject& fileName, const char *buffer, short size)    const    
  35.                             { return kIsMyFileType; };
  36.  
  37. };
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. #define WRITE_FLOAT(pbCur, _float)    {                                                \
  45.                                         float* __pfloat    = (float*)pbCur;            \
  46.                                         *(__pfloat++)    = _float;                    \
  47.                                         pbCur            = (PBYTE)__pfloat;            \
  48.                                     }
  49.  
  50. #define WRITE_PCHAR(pbCur, pchar)    {                                                \
  51.                                         char** __ppchar    = (char**)pbCur;            \
  52.                                         *(__ppchar++)    = pchar;                    \
  53.                                         pbCur            = (PBYTE)__ppchar;            \
  54.                                     }
  55.  
  56. #define WRITE_DWORD(pbCur, dword)    {                                                \
  57.                                         DWORD* __pdword    = (DWORD*)pbCur;            \
  58.                                         *(__pdword++)    = dword;                    \
  59.                                         pbCur            = (PBYTE)__pdword;            \
  60.                                     }
  61.  
  62. #define WRITE_WORD(pbCur, word)        {                                                \
  63.                                         WORD* __pword    = (WORD*)pbCur;                \
  64.                                         *(__pword++)    = word;                        \
  65.                                         pbCur            = (PBYTE)__pword;            \
  66.                                     }
  67.  
  68.  
  69. #define    SCENE_ROOT    "SCENE_ROOT"
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. #endif